//
//  Zobrist.swift
//  Chess5
//
//  Created by sun on 2017/4/12.
//  Copyright © 2017年 apple. All rights reserved.
//

import Foundation

public class Zobrist {
    var comCode: [[Int64]]
    var humCode: [[Int64]]
    let N = 15
    var code: Int64
    static let INF = 1000000000
    
     init() {
        comCode = [[Int64]]()
        humCode = [[Int64]]()
        for _ in 0..<N {
            var cRow = [Int64]()
            var hRow = [Int64]()
            for _ in 0..<N {
                cRow.append(Zobrist.Int64Random())
                hRow.append(Zobrist.Int64Random())
            }
            comCode.append(cRow)
            humCode.append(hRow)
        }
        code = Zobrist.Int64Random()
    }
    
    static func Int64Random() -> Int64 {
        let x: Int64 = Int64(Int(arc4random()) * INF)
        return x
    }
    
}
